package com.foton.limiter.construstlimiter.base.validator.impl;
import cn.hutool.core.util.StrUtil;
import com.foton.limiter.construstlimiter.base.validator.ParamValidator;
import com.foton.limiter.construstlimiter.base.validator.TransferRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author RenPu
 * @Date 2023/9/4 15:15
 * @Version 1.0
 * @Description: 金额校验
 **/

@Order(1)
@Slf4j
@Component
public class ParamValidatorImpl implements ParamValidator {
    @Override
    public void checkParam(TransferRequest transferRequest) {

        if(StrUtil.isBlank(transferRequest.getMoneparam().toString())){
           throw new RuntimeException("金额参数 &&&&&&&，不能为空。请进行检查！！！！");
        };
        log.info("PARAM  执行完成参数的校验："+transferRequest.getNOparam());
    }
}
